package com.itheima.conmmon;

/**
 * @author liwanhu
 * @datetime 2021/10/25 11:05
 */

/**
 * 线程级变量共享,只存在一个线程中
 * 从线程开始到结束前可以存取里面的值
 */
public class BaseContext {
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCreat(Long id) {
        threadLocal.set(id);
    }

    public static Long getCreatId() {
        return threadLocal.get();
    }
}
